<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8" />
	<title>test</title>
</head>
<body ng-app>
	<div ng-controller="HelloController">
		<p>{{greeting.text}}, Word</p>
		<div>{{test.text}}</div>
	</div>
	<hr />
	<div ng-controller="c2">
		<form action="">
			<input type="text" ng-change="computeNeed()" ng-model="nums.num" />
			result: {{needed}}
		</form>
	</div>
	
	<script type="text/javascript" src="js/angular.min.js" ></script>
	<script type="text/javascript">
        function HelloController( $scope ) {
        	// ajax
            $scope.greeting = { text: "Hello 1303A" };
            $scope.test = { text: "Hello test..." };
            
        }
        
        function c2 ( $scope ) {
        	$scope.nums = {num:0};
        	var computeNeed = function() {
        		$scope.needed = $scope.nums.num * 10 + ', haha...';
        	}
        	$scope.$watch("nums.num", computeNeed);
        }
    </script>
</body>
</html>
